<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>8_1_1-transition过度动画</title>
</head>

<body>


    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <style>
        .demo {
            width: 100px;
            height: 100px;
            background-color: red;

            /*动画属性*/
            transition-property: width, height, background-color;

            /*动画时长*/
            transition-duration: 1s;

            /*动画执行方式 - 线性方式*/
            transition-timing-function: linear;

            /*多久后执行动画*/
            transition-delay: 0.5s;
        }

        .demo-ani {
            width: 200px;
            height: 200px;
            background-color: blue;
            transition: width 2s, height 2s, background-color 2s;
        }

        .sd {
            height: 100px;

        }
    </style>
    <div id="Application">
        <div :class="cls" @click="run"></div>
    </div>
    <script>
        const App = Vue.createApp({
            data() {
                return {
                    cls: "demo"
                }
            },
            methods: {
                run() {
                    if (this.cls == "demo") {
                        this.cls = "demo-ani"
                    } else {
                        this.cls = "demo"
                    }
                }
            }
        })
        App.mount("#Application")
    </script>
</body>

</html>